<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.4.2.js"></script>
<title></title>
<style>
a{color:#333; font-size:14px; line-height:32px; text-decoration:none; }
a:hover{text-decoration:underline;}
.floatleft{float:left;}
.clear{clear:both;}
.block{width:90%;overflow:hidden;}
.border{border:1px solid #aaa;}
.circle_{border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px;}
.fonts{line-height:22px;}
.ipt{width:30px;}
</style>
</head>
<body>
<div class="floatleft clear"><a href="javascript:;" onclick="funcAddAds('ads_list')">追加输入框</a></div>
<form action="__URL__/adsindex" method="POST">
	<div class="floatleft clear" id="ads_list">
		<div class="floatleft">
			<div class="floatleft">位置：<input class="ipt" type="text" value="" name="position[]"/></div>
			<div class="floatleft">内容：<textarea name="ads[]" class="border circle_ fonts" rows="5" cols="90" ></textarea></div>
		</div>
	<?php foreach ($ads_arr as $k => $v) { 
		$v = (array)$v; 
		$position = $v['position'];
		$ads = stripslashes($v['ads']);
		?>
		<div class="floatleft">
			<div class="floatleft">位置：<input class="ipt" type="text" value="<?php echo $position;?>" name="position[]"/></div>
			<div class="floatleft">内容：<textarea name="ads[]" class="border circle_ fonts" rows="5" cols="90" ><?php echo $ads;?></textarea></div>
		</div>
		<?php
	} ?>
	</div>
	<div class="floatleft clear block"><input style="float:right;" type="submit" value="submit" name="submit" /></div>
</form>
<script>
function funcAddAds(id){
	var ele = '<div class="floatleft"><div class="floatleft">位置：<input class="ipt" type="text" value="" name="position[]"/></div><div class="floatleft">内容：<textarea name="ads[]" class="border circle_ fonts" rows="5" cols="90" ></textarea></div></div>';
	$("#"+id).prepend(ele);
}
</script>
</body>
</html>